package com.ctrip.demo.tree;

import java.util.ArrayList;
import java.util.List;

public class Node {
 
    private int id;
 
    private int pid;
 
    private String name;
 
    private String type;
 
    private List<Node> children = new ArrayList<>();
 
    public Node(int id, int pid) {
        this.id = id;
        this.pid = pid;
    }
 
    public Node(int id, int pid, String name, String type) {
        this(id, pid);
        this.name = name;
        this.type = type;
    }
 
    public int getId() {
        return id;
    }
 
    public void setId(int id) {
        this.id = id;
    }
 
    public int getPid() {
        return pid;
    }
 
    public void setPid(int pid) {
        this.pid = pid;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    public List<Node> getChildren() {
        return children;
    }
 
    public void setChildren(List<Node> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "Node{" +
                "id=" + id +
                ", pid=" + pid +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", children=" + children +
                '}';
    }
}